#!/bin/bash -e

function info() {
echo Usage: `basename $0` [-d] in.bam
exit 1
}

while getopts  ":dp:" opts
do
        case  $opts  in
        d) deldup=true;;
		p) out_prefix=$OPTARG;;
		*) info;;
        esac
done
shift $(($OPTIND - 1))


if [ $# -lt 1 ]; then info; fi


. $var

test -n "$deldup" && deldup='REMOVE_DUPLICATES=true'

echo; echo picard MarkDuplicates mark
$java_run/picard/MarkDuplicates.jar \
I=$1 \
O=$out_prefix.markdup.bam \
METRICS_FILE=$out_prefix.markdup.metrics.txt \
PROGRAM_RECORD_ID=dup \
PROGRAM_GROUP_NAME=dup \
CREATE_INDEX=true \
VALIDATION_STRINGENCY=SILENT \
AS=true \
$deldup


  